<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="sitemesh-decorator" prefix="decorator" %>
<%@ taglib uri="http://acegisecurity.org/authz" prefix="authz"%>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="security"%>
<%@ page import="com.webframe.util.MenuUtil" %>
<%@ page import="com.webframe.util.MenuUtil.MenuItem" %>
<html>
	<head>
		<title><decorator:title default="管理平台" /></title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<link href="${pageContext.request.contextPath}/stylesheets/stylesheet.css" rel="stylesheet" type="text/css"/>
		<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/common.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery-1.10.1.js"></script>
		<script type="text/javascript">
			var Constant_System_BasePath = '<%=(request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/")%>';
			var all_width;
	 		var all_height;
			$(document).ready(function(){
				all_width = getWindowWidth();
		 		all_height = getWindowHeight()-90;
		 		getMenu();
			});
			function getMenu()
			{
				/*
				 *	加入首页按钮
				 */
				var indexUrls = {};
				var indexBtnUrl = '/individualManage/DefaultPage.wf';
				  /*
				  * 用户具有多个权限的情况
				  * userRoleForIndex  用户默认登录首页 对应的权限
				  *
				  */
				 var userRoleForIndex = '<security:authentication property="principal.indexRole"/>';
				 if(userRoleForIndex!=''&& typeof indexUrls[userRoleForIndex]!='undefined')
				 {
					 indexBtnUrl = indexUrls[userRoleForIndex];
				 }
			}
	 		/**********问候语、时间显示**********/
			function sayHello()
	 		{
				  var myDate = new Date(<%=java.util.Calendar.getInstance().getTimeInMillis()%>);   
				  var myHour = myDate.getHours(); 
				  if(myHour<6)   
				  welcomeString = "凌晨好";   
				  else if(myHour<9)   
				  welcomeString = "早上好";   
				  else if(myHour<12)   
				  welcomeString = "上午好";   
				  else if(myHour<14)   
				  welcomeString = "中午好";   
				  else if(myHour<17)   
				  welcomeString = "下午好";   
				  else if(myHour<19)   
				  welcomeString = "傍晚好";   
				  else     
				  welcomeString = "夜里好";   

				  var arrayDay = ["日","一","二","三","四","五","六"];   
				  
				  document.getElementById("dateZone").innerHTML = myDate.getFullYear()+"年"+(myDate.getMonth()+1)+"月"+myDate.getDate()+"日   "+"星期"+arrayDay[myDate.getDay()];
			}
		</script>
		<decorator:head />
	</head>
	<body onload="<decorator:getProperty property="body.onload"/>;sayHello();">
		<div id="head" style="height: 90px;width: 100%;background-color: #B8CFEE;">
			<div id="main_bg" style="height:60px;">
				<div style="width:70%;height:20px;float: left;"></div>
				<div style="width:29%;height:20px;float: right;">
					<span id="dateZone"></span>
					<span style="margin-left: 5px;">
						<security:authentication property="principal.realName" />: 
						<a href="${pageContext.request.contextPath}/j_spring_security_logout">注销</a>
					</span>
				</div>
			</div>
			<div id="toolbar">
				<a href="${pageContext.request.contextPath}/user.html">用户管理</a>
				<a href="${pageContext.request.contextPath}/menu.html">菜单管理</a>
				<a href="${pageContext.request.contextPath}/chatroom/index.wf">聊天室</a>
				
			</div>
		</div>
		<!-- 正文 开始 -->
		<div id="content" style="overflow-y: auto;overflow-x: hidden;"><decorator:body /></div>
		<!-- 正文  结束 -->
		<div id="foot"></div>
	</body>
</html>

